package inner;

/**
 * @author oldliu
 * @since 1.0
 */
public class Hotel {
    private String name="儒家快捷酒店";
    private String addr="屯溪路191好";
    private String tele="189303093";

    public Hotel(String name, String addr, String tele) {
        this.name = name;
        this.addr = addr;
        this.tele = tele;
    }

    public License license=new License("包河-工-00001","2020-2025");
    public void show(){
        System.out.println("这家宾馆叫"+name+",地址在"+addr+",电话是"+tele);
    }
    public class License{
        private String no;
        private String riqi;

        public License(String no, String riqi) {
            this.no = no;
            this.riqi = riqi;
        }
        //每一个内部类都有一个外部类对象的引用
        public void show(){
            System.out.println("这个执照编号是"+no+"，日期是"+riqi);
            System.out.println("颁发给"+Hotel.this.name);
        }
    }
}
